package cn.cs.service;

import cn.cs.mapper.AgentLevelbPayMapper;
import cn.cs.mapper.AgentMapper;
import cn.cs.pojo.Agent;
import cn.cs.pojo.AgentInvoice;
import cn.cs.pojo.AgentLevelbPay;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;


@RestController
public class AgetnLevelbPayService {

    //@Autowired
    @Resource
    private AgentLevelbPayMapper agentLevelbPayMapper;

    @RequestMapping(value = "/getAgentLevelbPayById", method = RequestMethod.POST)
    public AgentLevelbPay getAgentLevelbPayById(@RequestParam("id") String id) throws Exception{
        return agentLevelbPayMapper.getAgentLevelbPayById(id);
    }

    @RequestMapping(value = "/getAgentLevelbPayListByMap", method = RequestMethod.POST)
    public List<AgentLevelbPay> getAgentLevelbPayListByMap(@RequestBody Map<String, Object> param) throws Exception{
        return agentLevelbPayMapper.getAgentLevelbPayListByMap(param);
    }

    @RequestMapping(value = "/getAgentLevelbPayCountByMap", method = RequestMethod.POST)
    public Integer getAgentLevelbPayCountByMap(@RequestBody Map<String, Object> param) throws Exception{
        return agentLevelbPayMapper.getAgentLevelbPayCountByMap(param);
    }

    @RequestMapping(value = "/addAgentLevelbPay", method = RequestMethod.POST)
    public Integer addAgentLevelbPay(@RequestBody AgentLevelbPay agentLevelbPay) throws Exception{
        return agentLevelbPayMapper.insertAgentLevelbPay(agentLevelbPay);
    }

    @RequestMapping(value = "/modifyAgentLevelbPay", method = RequestMethod.POST)
    public Integer modifyAgentLevelbPay(@RequestBody AgentLevelbPay agentLevelbPay) throws Exception{
        return agentLevelbPayMapper.updateAgentLevelbPay(agentLevelbPay);
    }

    @RequestMapping(value = "/deleteAgentLevelbPayById", method = RequestMethod.POST)
    public Integer deleteAgentLevelbPayById(@RequestParam("id") String id) throws Exception{
        return agentLevelbPayMapper.deleteAgentLevelbPayById(id);
    }

    @RequestMapping(value = "/modifyAgentInvoice", method = RequestMethod.POST)
    public Integer modifyAgentInvoice(@RequestBody AgentInvoice agentInvoice) throws Exception{
        return agentLevelbPayMapper.modifyAgentInvoice(agentInvoice);
    }



}
